#include <iostream>
#include <string>
using namespace std;
class Student
{
public:
    Student(const string& n = "", int i = 0) : name(n), id(i)
    {
        cnt++;
    }

    Student(const Student& other) : name(other.name), id(other.id)
    {
        cnt++;
    }

    ~Student()
    {
        cnt--;
    }

    void display() const
    {
        cout << "姓名：" << this->name << "，学号：" << id << endl;
    }

    void setName(string sname)
    {
        this->name=sname;
    }

    void setID(int sid)
    {
        id=sid;
    }
    static int Total()
    {
        return cnt;
    }
private:
    string name;
    int id;
    static int cnt;
};

int Student::cnt=0;

void func()
{
    Student tmp;
    tmp.display();
}

int main()
{
    Student s1("张三", 2023001);
    s1.display();
    cout << "当前学生总数：" << Student::Total() << endl;

    func();
    cout << "当前学生总数：" << Student::Total() << endl;

    Student s2=s1;
    cout << "当前学生总数：" << Student::Total() << endl;

    return 0;
}